export interface DefaultResult<T = any>{
    code: string,
    msg: string,
    data: T
    success: boolean,
    timestamp: string
}



// ===== 登陆类型
export interface LoginForm{
    username: string,
    pwd: string
}

export interface TokenRes{
    accessToken: string,
    refreshToken: string,
    accessTokenExpAt: number,
    refreshTokenExpAt: number,
    jti: string
}

export interface UserPrincipal{
    id: string,
    username: string,
    nickName: string,
    email: string,
    mobile: string,
    loginIp: string,
    jti: string,
    loginTime: Date | null | undefined,
    avatar?: string|undefined|null,
    roles: string[]
}


export interface MenuData{
    id?: string,
    name?: string,
    code?: string,
    url?: string,
    pid?: string,
    level?: number,
    component?: string,
    type?: number,
    orderNum?: number,
    icon?: string,
    description?: string,
    createTime?: Date,
    createBy?: string,
    updateTime?: Date,
    updateBy?: string,
    available?: boolean,
    children?: MenuData[]
}

export enum OrderDirection {
    DESC="DESC",
    ASC="ASC"
}

export interface Order{
    direction: OrderDirection,
    property: string,
}



export interface PageQueryCommonParams{
    page?: number,
    size?: number,
    orders?: Order[]
}


export interface UserPageQuery extends PageQueryCommonParams{
    available?: boolean,
    email?: string,
    key?: string,
    locked?: boolean,
    mobile?: string
}


export interface PageObj<T> {
    records: T[],
    total: number,
    size: number,
    current: number,
    pages: number
}

export interface RoleVO{
    id: string,
    roleName: string,
    roleCode: string,
    description: string
}

export interface UserVO{
    id: string,
    username: string,
    nickName: string,
    email: string,
    mobile: string,
    avatar: string,
    locked: boolean,
    available: boolean,
    createTime: Date,
    lastLogin: Date,
    roles: RoleVO[]
}
